The present invention relates to lock management in a database management system and more specifically, to lock management of database commands configured for adding resources to a database or for removing resources from a database.
In transaction processing and corresponding databases, a two-phase commit protocol (2PC) is commonly used to coordinate all the processes that participate in a distributed atomic transaction on whether to commit or abort (roll back) the transaction. In particular, the 2PC protocol is used to coordinate processes that concurrently operate on one or more database tables which will have a different effect on the state of a database in dependence on the (typically unpredictable) question which ones of the two commands commits first. However, the 2PC protocol is not resilient to all possible failure scenarios, and the log records used by the protocol's recovery procedures to recover from failures are typically slow to generate. The implementation of the 2PC protocol is often high complex, computationally demanding and it may introduce new problems (e.g. in-doubt transactions, i.e., transactions executed in accordance with the 2PC protocol which are affected by a system or network error during any of the phases of the 2PC protocol).
Extensive locking of databases and database tables according to other protocols may also have some disadvantages as the exclusive locking of the above mentioned concurrent database queries may significantly slow down other queries submitted to the database before said locked two queries have committed.